package com.bootdo.mall.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.mall.dao.MallIndexCategoryDao;
import com.bootdo.mall.domain.MallIndexCategory;
import com.bootdo.mall.service.MallIndexCategoryService;



@Service
public class MallIndexCategoryServiceImpl implements MallIndexCategoryService {
	@Autowired
	private MallIndexCategoryDao mallIndexCategoryDao;
	
	@Override
	public MallIndexCategory get(Long id){
		return mallIndexCategoryDao.get(id);
	}
	
	@Override
	public List<MallIndexCategory> list(Map<String, Object> map){
		return mallIndexCategoryDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return mallIndexCategoryDao.count(map);
	}
	
	@Override
	public int save(MallIndexCategory mallIndexCategory){
	
		if(mallIndexCategory.getId() != null) {
			return mallIndexCategoryDao.update(mallIndexCategory);
		}else {
			return mallIndexCategoryDao.save(mallIndexCategory);
		}		
	
		
	}
	
	@Override
	public int update(MallIndexCategory mallIndexCategory){
		return mallIndexCategoryDao.update(mallIndexCategory);
	}
	
	@Override
	public int remove(Long id){
		return mallIndexCategoryDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return mallIndexCategoryDao.batchRemove(ids);
	}
	
}
